package com.corejsf;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

/**
 * This bean stores user form inputs for the Login and Add User
 * forms.
 *
 * @author Vukasin Simic
 * @version 1.0
 */
@Named ("credentials")
@RequestScoped
public class Credentials {
    /**
     * Unique username of a user.
     *
     * Used as a login credential.
     */
    private String username;
    /**
     * User account password.
     *
     * Used as a login credential.
     */
    private String password;
    /**
     * User last name, used primarily for greetings.
     */
    private String lastName;
    /**
     * User first name, used primarily for greetings.
     */
    private String firstName;
    /**
     * Admin authorization. Grants special privileges.
     */
    private boolean admin;

    /**
     * Gets username form input.
     *
     * @return unique username of a user account.
     */
    public String getUsername() {
        return username;
    }
    /**
     * Sets username of user account.
     *
     * @param username entered into form field
     */
    public void setUsername(final String username) {
        this.username = username;
    }

    /**
     * Gets password form input.
     *
     * @return password
     */
    public String getPassword() {
        return password;
    }
    /**
     * Sets password of user account.
     *
     * @param password form input
     */
    public void setPassword(final String password) {
        this.password = password;
    }

    /**
     * Gets last name form input.
     *
     * @return lastName
     */
    public String getLastName() {
        return lastName;
    }
    /**
     * Sets last name of user account.
     *
     * @param lastName form input
     */
    public void setLastName(final String lastName) {
        this.lastName = lastName;
    }

    /**
     * Gets first name form input.
     *
     * @return firstName
     */
    public String getFirstName() {
        return firstName;
    }
    /**
     * Sets first name of user account.
     *
     * @param firstName form input
     */
    public void setFirstName(final String firstName) {
        this.firstName = firstName;
    }
    /**
     * Gets admin form input.
     *
     * @return admin
     */
    public boolean isAdmin() {
        return admin;
    }
    /**
     * Sets admin authorization for user account.
     *
     * @param isAdmin form input
     */
    public void setAdmin(final boolean isAdmin) {
        this.admin = isAdmin;
    }

}
